<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
?>
<div style="width:700px; height:400px">
  <p align="left">发帖用户：<strong><?php echo getUser($rs['uid']);?></strong></p>
  <div>
    <form class="form-horizontal" method="post" id="form_add">
    <input name="fid" type="hidden" value="<?php echo $rs['fid'];?>" />
      <div class="form-group">
        <label class="col-sm-1 control-label" style="width:100px;">标题</label>
        <div class="col-sm-9">
            <input type="text" id="title" name="title" placeholder="必填" data-required="true" class="form-control" value="<?php echo $rs['title'];?>">
        </div>
    </div>        
      <div class="form-group">
        <label class="col-sm-2 control-label" style="width:100px;">内容</label>
        <div class="col-sm-9" id="show-content"> 
          <!---->
          <div id="reply-content-list">
            <textarea class="form-control" id="forum-content" name="content"  style="height:250px"><?php echo $rs['content'];?></textarea>
            <p class="help-block"></p>
          </div>
          <!---->
        </div>
      </div>
      <p></p>
      <p class="btn-group btn-group-justified"><a class="btn btn-success" href="javascript:;" id="send">提交数据</a></p>
      <p></p>
    </form>
  </div>
</div>
<script>
$(function(){
	$('#send').click(function(){
		var title=$("#title").val();
		var content=$("#forum-content").val();
		if (!title){
			Msg.error('积分数量不能为空');
			return false;
		}
		if (!content){
			Msg.error('积分数量不能为空');
			return false;
		}
		Msg.loading('正在保存...');
		$.post('<?php echo U('forum/save');?>',$("#form_add").serialize(),function(result){
			Msg.hide();
			if (result.status==1){
				Msg.ok('编辑成功',function(){jQuery(document).trigger('close.facebox');document.location.reload()},1000);	
			}else{
				Msg.error(result.info);	
			}
		},'json');
	  return false;
	})	
})
</script>